using System;
using System.Collections.Generic;
using System.Text;

namespace RikMigrations
{
	public class CompoundForeignKey
	{
		public CompoundForeignKey( string name, Table table, string[] columns, string foreignTable, string foreignSchema, string[] foreignColumns )
		{
			this.Name = name;
			this.Table = table;
			this.Columns = columns;
			this.ForeignTable = foreignTable;
			this.ForeignSchema = foreignSchema;
			this.ForeignColumns = foreignColumns;
		}

		#region Properties

	    public string Name { get; set; }

	    public Table Table { get; set; }

	    public string[] Columns { get; set; }

	    public string ForeignTable { get; set; }

		public string ForeignSchema { get; set; }

	    public string[] ForeignColumns { get; set; }

	    public CascadeOptions DeleteCascadeOption { get; set; }

	    public CascadeOptions UpdateCascadeOption { get; set; }

	    #endregion

		public CompoundForeignKey OnDelete( CascadeOptions option )
		{
			DeleteCascadeOption = option;
			return this;
		}

		public CompoundForeignKey OnUpdate( CascadeOptions option )
		{
			UpdateCascadeOption = option;
			return this;
		}
	}
}